package com.woniu.service.impl;

import com.woniu.pojo.Comment;
import com.woniu.mapper.CommentMapper;
import com.woniu.service.ICommentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.vo.CommentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Yellow Docker
 * @since 2022-11-21
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements ICommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Override
    public List<Comment> getServiceComment(Integer id) {
        List<Comment> comments = commentMapper.getServiceComment(id);
        return comments;
    }

    @Override
    public List<Comment> getShopComment(Integer id) {
        List<Comment> comments = commentMapper.getShopComment(id);
        return comments;
    }

    @Override
    public List<CommentVo> getShopAvgComment(Date date) {
        return commentMapper.getShopAvgComment(date);
    }


}
